package com.asifrc.tw101;

/**
 * Created by asifrc on 2/11/14.
 */
public class Diamond extends MultiLine {

    public Diamond(int n) {
        super(n);
    }

    public Diamond(int n, String name) {
        super(n);
        Line nameLine = new Line(name);
        getLines().set(n - 1, nameLine);
    }

    @Override
    void draw(int n) {
        IsoscelesTriangle top = new IsoscelesTriangle(n);
        IsoscelesTriangle bottom = new IsoscelesTriangle(n);
        bottom.invert();
        bottom.getLines().remove(0);
        top.getLines().addAll(bottom.getLines());
        for (Line line : top.getLines()) {
            addLine(line);
        }
    }
}
